package com.google.code.javascribd;

import static org.junit.Assert.assertEquals;
import javax.activation.MimetypesFileTypeMap;
import org.junit.Before;
import org.junit.Test;

public class MimeTypes {

	private MimetypesFileTypeMap mimeTypeMap;

	@Before
	public void setUp() throws Exception {
		mimeTypeMap = new MimetypesFileTypeMap();
	}

	@Test
	public void testMimeTypes() {
		assertEquals("pdf file mime type", "application/pdf", mimeTypeMap.getContentType(".pdf"));
		assertEquals("txt file mime type", "text/plain", mimeTypeMap.getContentType(".txt"));
		assertEquals("rtf file mime type", "application/rtf", mimeTypeMap.getContentType(".rtf"));
	}
}
